package com.demo.cloud.h2.service.impl;

import com.demo.cloud.h2.bo.StaffBo;
import com.demo.cloud.h2.repo.StaffRepository;
import com.demo.cloud.h2.service.IStaffService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

@Service
public class StaffServiceImpl implements IStaffService {


    @Autowired
    StaffRepository staffRepository;
    @Override
    public List<StaffBo> queryAllStaffList() {
        Iterable<StaffBo> iterable = staffRepository.findAll();
        List<StaffBo> list=new ArrayList<StaffBo>();
        Iterator<StaffBo> iterator = iterable.iterator();
        while(iterator.hasNext()){
            StaffBo next = iterator.next();
            list.add(next);
        }
        return list;
    }
}
